<?php
global $id,$page,$pagesize;

$id = isset($_REQUEST['id']) ? trim($_REQUEST['id']): '';
$table = 'duihua';
$pagesize = 20;
$duihua = new Duihua();
switch ($act){
	case 'manage' :
		$mng = $duihua->manage();
		break;
		
		
	case 'add' :
		if ($submit){
			$data = $_POST['data'];
			$duihua->db->insert($duihua->table, $data);
			showmessage('添加成功！','?mod=duihua');
		}else{
			$add = Array("uid" =>3031283052 ,"uname" =>'henter' ,"touid" =>'' ,"touname" =>'' ,"content" =>'' ,"time" =>time() ,"changjing" =>'' ,"juese" =>'');
			break;
		}
		
		
	case 'edit' :
		if ($submit){
			$data = $_POST['data'];
			$duihua->db->update($duihua->table, $data);
			showmessage('修改成功！','?mod=duihua');
		}else{
			$edit = $duihua->edit();
			break;
		}
		
		
	case 'del' :
		$del = $duihua->del();
		showmessage('删除成功！','?mod=duihua');
		break;
}

include admintpl($mod.'.'.$act);
?>